package com.shop.domain.system;


import com.alibaba.fastjson.annotation.JSONField;
import com.shop.jpa.domain.BaseDomain;
import com.shop.jpa.support.JpaConst;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>实体类</p>
 * <p>Table: t_system_city - 城市表</p>
 * @author generator
 * @date 2020-11-20 09:05:18
 */
@ApiModel("SystemCity 城市表")
@Data
@Entity
@Table(name="t_system_city")
@SQLDelete(sql = "update t_system_city set is_deleted = 1 where id = ?")
@Where(clause = JpaConst.WHERE_CLAUSE_NOT_DELETED)
@DynamicInsert(true)
@DynamicUpdate(true)
public class SystemCity extends BaseDomain implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ApiModelProperty(value = "id", hidden = true)
    @Column(name = "id")
    @JSONField(serialize=false)
    private Long id;

    /**
	 * 城市id
	 */
	@Column(name = "city_id")
    @ApiModelProperty("城市id")
    private Integer cityId;

    /**
     * 省市级别
     */
    @Column(name = "level")
    @ApiModelProperty("省市级别")
    private Integer level;

    /**
     * 父级id
     */
    @Column(name = "parent_id")
    @ApiModelProperty("父级id")
    private Integer parentId;

    /**
     * 区号
     */
    @Column(name = "area_code")
    @ApiModelProperty("区号")
    private String areaCode;

    /**
     * 名称
     */
    @Column(name = "name")
    @ApiModelProperty("名称")
    private String name;

    /**
     * 合并名称
     */
    @Column(name = "merger_name")
    @ApiModelProperty("合并名称")
    private String mergerName;

    /**
     * 经度
     */
    @Column(name = "lng")
    @ApiModelProperty("经度")
    private String lng;

    /**
     * 纬度
     */
    @Column(name = "lat")
    @ApiModelProperty("纬度")
    private String lat;

    /**
     * 是否展示
     */
    @Column(name = "is_show")
    @ApiModelProperty("是否展示")
    private Integer isShow;


    /**
	 * 创建时间
	 */
	@Column(name = "create_time")
    @ApiModelProperty("创建时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
	 * 最后一次更新时间
	 */
	@Column(name = "update_time")
    @ApiModelProperty("最后一次更新时间")
    @JSONField(serialize=false)
    private Date updateTime;

    /**
	 * 是否删除 0：不删除   1：删除
	 */
	@Column(name = "is_deleted")
    @ApiModelProperty("是否删除 0：不删除   1：删除")
    @JSONField(serialize=false)
    private Integer isDeleted;
}